/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package webResource;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

/**
 * REST Web Service
 *
 * @author Jorge
 */
@Path("messaging")
public class ServiceMessaging {

    
    /**
     * Creates a new instance of MessagingServer
     */
    public ServiceMessaging() {
    }

    /**
     * Retrieves representation of an instance of webResource.MessagingServer
     * @return an instance of java.lang.String
     */
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String sendMessage(@QueryParam("receiptCode") String receiptCode, @QueryParam("BookingCode") String BookingCode, @QueryParam("clientName") String clientName) {
        String message = "";
		message += "Dear " + clientName + ",\n";
		message += "Thank you for choosing our travel agency.\n";
		message += "Your receipt #" + receiptCode + " ";
		message += "for the flight booking code " + BookingCode + "\n";
		message += "was successfully registered in our system.\n"; 
		message += "Have a nice trip!";
		
		return message;  
    }
}
